# vim: filetype=zsh

# MNEMONIC: [F]uzzy search [.]dotfiles
# SYNOPSIS: f. [QUERY]
# DESCRIPTION: Fuzzy search for the dotfiles and open the selected files via vim

local home="/Users/rockyzhang"
local selections=($(git --git-dir="$home"/dotfiles/ --work-tree="$home" ls-files "$home" --full-name | sed "s~^~$home/~" | fzf --query="$1" --prompt="Dotfiles> "))
if [[ -n "$selections" ]]; then
  ${EDITOR:-vim} "${selections[@]}"
fi
